<?php

namespace App\Models;

use App\Models\Traits\ProjectTrait;
use Illuminate\Database\Eloquent\Model;

/**
 * App\Models\Row
 *
 * @property int $id
 * @property int $project_id 项目ID
 * @property int $prev_id 上一行
 * @property int $next_id 下一行
 * @property int $locked 是否锁住
 * @property int $level 缩进
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereLevel($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereLocked($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereNextId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row wherePrevId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereProjectId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Models\Row whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Models\Cell[] $cells
 * @property-read int|null $cells_count
 * @property-read \App\Models\Project $project
 */
class Row extends Model
{
    use ProjectTrait;
    protected $fillable = [
        'project_id',
        'prev_id',
        'next_id',
        'locked',
        'level',
    ];

    public function cells()
    {
        return $this->hasMany(Cell::class);
    }
}
